package com.contract.spirit.bean.entity

import android.text.TextUtils
import com.contract.spirit.R

class User {
    var token: String? = null
    var userId: String? = null
    var phone: String? = null
    var nickname: String? = null
    var avatarUrl: String? = null
    var totalAmount: String? = null
    var unCashAmount: String? = null
    private var isSetPayPwd = 0
    var inviteCode: String? = null
    fun isSetPassword(): Boolean {
        return isSetPayPwd == 1
    }

    fun getIsSetPayPwd(): Int {
        return isSetPayPwd
    }

    fun getAvatar(): Comparable<*>? {
        return if (TextUtils.isEmpty(avatarUrl)) {
            R.mipmap.icon_default_avatar
        } else {
            avatarUrl
        }
    }

    fun setIsSetPayPwd(isSetPayPwd: Int) {
        this.isSetPayPwd = isSetPayPwd
    }
}